package com.example.manu_facturer_orders.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.manu_facturer_orders.pojo.ManuFacturerOrdersVO;
import com.example.manu_facturer_orders.pojo.PageResult;
import com.example.manu_facturer_orders.service.ManuFacturerOrdersService;
import commons.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: tobed
 * @date: 2022/9/7
 * @time: 17:26
 */
@RestController
@RequestMapping("vendor")
public class ManuFacturerOrdersController {

    @Autowired
    ManuFacturerOrdersService vendorService;

    /**
     * 全查厂商订单
     * @return
     */
    @RequestMapping("list")
    public Result list(
            @RequestParam Integer payType,
            @RequestParam String orderNumber,
            @RequestParam Integer manuFactureId,
            PageResult pageResult){
        Page<ManuFacturerOrdersVO> list = vendorService.listVendor(payType,orderNumber,manuFactureId,new Page<>(pageResult.getPageNum(), pageResult.getPageSize()));
        return Result.success(list);
    }


}
